<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="ihis.model.*" %>
<%@ page import="ihis.tms.client.*" %>
<%@ page import="java.util.Vector" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>Project/Team/Personal Schedule Report</title>
	<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a4/jquery.mobile-1.0a4.min.css" />
	<link type="text/css" href="http://dev.jtsage.com/cdn/datebox/latest/jquery.mobile.datebox.css" rel="stylesheet" /> 
	<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script> 
	<script type="text/javascript">
		$( document ).bind( "mobileinit", function(){
			$.mobile.page.prototype.options.degradeInputs.date = 'text';
		});	
	</script>
	<script type="text/javascript" src="http://code.jquery.com/mobile/1.0a4/jquery.mobile-1.0a4.min.js"></script>
	<script type="text/javascript" src="http://dev.jtsage.com/cdn/datebox/latest/jquery.mobile.datebox.js"></script>
</head>
<body>
	<div id="scheduleSearch" data-role="page" data-theme="a">
    
    <script>
    	function search(){
    		document.search_schedule.submit();
    	}
    	
    	$(function(){
    		$("#startDate").datepicker();
    	});
    	
    	$(function(){
    		$("#endDate").bind("click", function(){
    			$("#endDate").datepicker();
    		});
    	});
    </script>
    
    	<div data-role="header">
			<a href="report/schedule.jsp" data-icon="back" data-rel="back" data-transition="reverse">Cancel</a>
			<h1>SEARCH</h1>
			<a href="javascript:search()" data-icon="search" data-transition="reverse">Search</a>
		</div>
    
    	<div data-role="content">
			<form action="schedule.jsp" method="post" name="search_schedule"  data-theme="e">
				<div data-role="fieldcontain">
					<!-- 시작/종료일 -->
					<label for="startDate">Start Date :</label>
					<input type="text" name="startDate" id="startDate"/>
					<label for="endDate">End Date :</label>
					<input type="date" name="endDate" id="endDate" value="" />
					
					<!-- 기간 종류 -->
					<fieldset data-role="controlgroup">
						<legend>Choose Periodic Type :</legend>
						<input class=radiobox type="radio" name="periodicType" id="monthly" value="1" checked="checked" />
						<label for="monthly">Monthly</label>
						
						<input class=radiobox type="radio" name="periodicType" id="weekly" value="2" />
						<label for="weekly">Weekly</label>
					</fieldset>
					
					<!-- 담당자  ->
					<label for="user">User :</label>
					<input type="text" name="user" id="user" value="" /--> 
					
									<!-- 프로젝트 -->
					<label for="select_user">Choose User :</label>
					<select name="select_user" id="select_user" data-native-menu="true">
						<option value="0">ALL</option>
					<% 
				  		IHISTMSClient tms = new IHISTMSClient();
						Vector<Member> mresult = tms.getUsers();
						if(mresult != null)
						{
							for(int i =0; i<mresult.size(); i++)
							{
					%>
					
						<option value="<%=mresult.get(i).getId()%>"><%=mresult.get(i).getName() %></option>
					<%
							}
						}
					%>
					</select>
								
					<!-- 프로젝트 -->
					<label for="select_project">Choose Project :</label>
					<select name="select_project" id="select_project" data-native-menu="true">
						<option value="0">ALL</option>
					<% 
						Vector<Project> presult = tms.getProjects();
						if(presult != null)
						{
							for(int i =0; i<presult.size(); i++)
							{
					%>
					
						<option value="<%=presult.get(i).getId()%>"><%=presult.get(i).getName() %></option>
					<%
							}
						}
					%>
						
					</select>
	
					<!-- 팀  -->
					<label for="select_team">Choose Team :</label>
					<select name="select_team" id="select_team" data-native-menu="true">
						<option value="0">ALL</option>
					<% 
						Vector<Team> tresult = tms.getTeams();
						if(tresult != null)
						{
							for(int i =0; i<tresult.size(); i++)
							{
					%>
					
						<option value="<%=tresult.get(i).getId()%>"><%=tresult.get(i).getName() %></option>
					<%
							}
						}
					%>
						
					</select>				
					<!-- Search Button -->
					<input type="submit" name="submit" value="Search" onClick="search()" />
				</div>
			</form>
    		
    		<!--form method="post" action="#">
			 <div data-role="fieldcontain">
				<input value="01-01-2011" name="CompleteDate" type="date" data-role="datebox" id="CompleteDate" data-options='{"mode": "calbox", "useDialogForceFalse": true, "dateFormat": "MM/DD/YYYY"}' />
			</div-->
                
		</form>	
    	</div>
	</div>
</body>
</html>